package com.eastfair.certificate.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.certificate.enumeration.CertificateCertificateTypeEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 证件设置
 * </p>
 *
 * @author ligang
 * @since 2023-02-03
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cert_certificate")
@ApiModel(value = "Certificate", description = "证件设置")
@AllArgsConstructor
public class Certificate extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 证件类型:#{CAR:车证;PEOPLE:人证;POWER:机力车证;OTHER:其他证;}
     */
    @ApiModelProperty(value = "证件类型:#{CAR:车证;PEOPLE:人证;POWER:机力车证;OTHER:其他证;}")
    @TableField(value = "certificate_type")
    @Excel(name = "证件类型:#{CAR:车证;PEOPLE:人证;POWER:机力车证;OTHER:其他证;}", replace = {"车证_CAR", "人证_PEOPLE", "机力车证_POWER", "其他证_OTHER",  "_null"})
    private CertificateCertificateTypeEnum certificateType;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    @Size(max = 256, message = "名称长度不能超过256")
    @TableField(value = "name", condition = LIKE)
    @Excel(name = "名称")
    private String name;

    /**
     * 工本费
     */
    @ApiModelProperty(value = "工本费")
    @TableField(value = "cost_money")
    @Excel(name = "工本费")
    private BigDecimal costMoney;

    /**
     * 超时费
     */
    @ApiModelProperty(value = "超时费")
    @TableField(value = "over_time_money")
    @Excel(name = "超时费")
    private BigDecimal overTimeMoney;

    /**
     * 押金
     */
    @ApiModelProperty(value = "押金")
    @TableField(value = "deposit_money")
    @Excel(name = "押金")
    private BigDecimal depositMoney;

    /**
     * 二审更新时间
     */
    @ApiModelProperty(value = "二审更新时间")
    @TableField(value = "second_auth_time")
    @Excel(name = "二审更新时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime secondAuthTime;

    /**
     * 二审
     */
    @ApiModelProperty(value = "二审")
    @TableField(value = "second_auth_id")
    @Excel(name = "二审")
    private Long secondAuthId;

    /**
     * 初审更新时间
     */
    @ApiModelProperty(value = "初审更新时间")
    @TableField(value = "first_auth_time")
    @Excel(name = "初审更新时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime firstAuthTime;

    /**
     * 初审
     */
    @ApiModelProperty(value = "初审")
    @TableField(value = "first_auth_id")
    @Excel(name = "初审")
    private Long firstAuthId;

    /**
     * 已使用指标数
     */
    @ApiModelProperty(value = "已使用指标数")
    @TableField(value = "use_index_number")
    @Excel(name = "已使用指标数")
    private Integer useIndexNumber;

    /**
     * 指标数
     */
    @ApiModelProperty(value = "指标数")
    @TableField(value = "index_number")
    @Excel(name = "指标数")
    private Integer indexNumber;

    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间")
    @TableField(value = "start_time")
    @Excel(name = "开始时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    @ApiModelProperty(value = "结束时间")
    @TableField(value = "end_time")
    @Excel(name = "结束时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime endTime;

    /**
     * 表单组id
     */
    @ApiModelProperty(value = "表单组id")
    @TableField(value = "filed_group_id")
    @Excel(name = "表单组id")
    private Long filedGroupId;

    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会id")
    private Long exhibitionId;

    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 团队id
     */
    @ApiModelProperty(value = "团队id")
    @TableField(value = "team_id")
    @Excel(name = "团队id")
    private Long teamId;


    @Builder
    public Certificate(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    CertificateCertificateTypeEnum certificateType, String name, BigDecimal costMoney, BigDecimal overTimeMoney, BigDecimal depositMoney, 
                    LocalDateTime secondAuthTime, Long secondAuthId, LocalDateTime firstAuthTime, Long firstAuthId, Integer useIndexNumber, Integer indexNumber, 
                    LocalDateTime startTime, LocalDateTime endTime, Long filedGroupId, Long exhibitionId, Integer isEnabled, Integer isDeleted, 
                    Long tenantId, Long projectId, Long subsystemId, Long teamId) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.certificateType = certificateType;
        this.name = name;
        this.costMoney = costMoney;
        this.overTimeMoney = overTimeMoney;
        this.depositMoney = depositMoney;
        this.secondAuthTime = secondAuthTime;
        this.secondAuthId = secondAuthId;
        this.firstAuthTime = firstAuthTime;
        this.firstAuthId = firstAuthId;
        this.useIndexNumber = useIndexNumber;
        this.indexNumber = indexNumber;
        this.startTime = startTime;
        this.endTime = endTime;
        this.filedGroupId = filedGroupId;
        this.exhibitionId = exhibitionId;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.tenantId = tenantId;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.teamId = teamId;
    }

}
